package com.tm.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.VendorExtension;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.AbstractCollection;
import java.util.ArrayList;

/**
 * @program: springboot02
 * @description:
 * @author: 小仝
 * @create: 2023-04-12 19:21
 **/

@Configuration
@EnableSwagger2
public class SwaggerConfig {

    @Bean
    public Docket docket(){
        Docket docket = new Docket(DocumentationType.SWAGGER_2).groupName("QY163").apiInfo(getInfo()).select().apis(RequestHandlerSelectors.basePackage("com.tm.controller")).build();
        return docket;
    }
    private ApiInfo getInfo(){
        Contact contact = new Contact("小仝","http://www.baidu.com","236@qq.com");
        ApiInfo apiInfo = new ApiInfo("QY163心理健康测试", "QY163心理健康测试", "2.3.6", "http://www.jd.com",
                contact, "珊璐科技有限公司", "http://www.shanlu.com", new ArrayList<VendorExtension>());
              return apiInfo;
    }
}
